﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ASPItalia.ModelVirtualCasting.WPF.ViewModels;

namespace ASPItalia.ModelVirtualCasting.WPF.Views
{
    /// <summary>
    /// Interaction logic for NewCandidatesView.xaml
    /// </summary>
    public partial class NewCandidatesView : Window
    {
        public NewCandidatesView()
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(NewCandidatesView_Loaded);
        }

        void NewCandidatesView_Loaded(object sender, RoutedEventArgs e)
        {
            if (this.DataContext != null)
                ((NewCandidatesViewModel)this.DataContext).LoadAsync();
        }

        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void CloseButton_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
